<{include file="header.html"}>

<script type="text/javascript">

	function validate()
	{
		var title = document.getElementById('TITLE');
		var short_content = document.getElementsByName('SHORT_CONTENT')[0];
		var long_content = document.getElementsByName('LONG_CONTENT')[0];

		// update content of CKEDITOR to textareas
		CKEDITOR.instances.LONG_CONTENT.updateElement();

		// checking TITLE
		if(isEmptyTextBox(title, '<{$smarty.const._MSG_TITLE_IS_EMPTY|utf8_escape_js}>'))
			return false;

		if(!isValidLengthTextBox(title, <{$smarty.const.MAX_LENGTH_TITLE}>, '<{$smarty.const._MSG_TITLE_IS_TOO_LONG|utf8_escape_js}>')){
            return false;
        }

		// checking LONG_CONTENT
		if(isEmptyTextBox(long_content, '<{$smarty.const._MSG_LONG_CONTENT_IS_EMPTY|utf8_escape_js}>'))
			return false;

		document.user_form.submit();
	}



</script>

		<div class="box_two_third">
			<div class="box_head"><{$smarty.const._LB_EVENT_MANAGEMENT|utf8_escape_html}></div>
			<div class="box_content">

				<form enctype="multipart/form-data" action="<{$smarty.server.REQUEST_URI}>" method="post" name="user_form">
				<input type="hidden" id="ID" value="<{$press->ID}>"/>
				<input type="hidden" id="act" name="act" value="<{$smarty.const.ACT_VALID_EDIT}>"/>
				<table>
                    <tr>
						<td ><{$smarty.const._LB_TITLE|utf8_escape_html}>&nbsp;:&nbsp;<{$smarty.const._LB_REQUIRE_FIELD}></td>
						<td colspan="3"><input name="TITLE" id="TITLE" type="text" class="long_input" value="<{$event->TITLE|utf8_escape_html}>" /></td>
					</tr>
					<tr>
						<td><{$smarty.const._LB_IMAGE|utf8_escape_html}>: </td>
						<td>
							<{if $event->IMAGE}>
								<img style="display: block; opacity: 1; cursor: pointer;" src="<{$smarty.const.IMAGE_URL}>/thumb<{$event->IMAGE}>">
								<br/>
							<{/if}>
							<input type="file" name="IMAGE" id="IMAGE" size="60" >
						</td>
					</tr>
                    <tr>
						<td ><{$smarty.const._LB_SHORT_CONTENT|utf8_escape_html}>&nbsp;:&nbsp;<{$smarty.const._LB_REQUIRE_FIELD}></td>
						<td colspan="3">
                            <textarea name="SHORT_CONTENT" id="SHORT_CONTENT" class="long_input" rows="6" ><{$event->SHORT_CONTENT}></textarea>
                        </td>
					</tr>
					<tr>
						<td ><{$smarty.const._LB_LONG_CONTENT|utf8_escape_html}>&nbsp;:&nbsp;<{$smarty.const._LB_REQUIRE_FIELD}></td>
						<td colspan="3">
                            <{$CKEditor->editor("LONG_CONTENT",$event->LONG_CONTENT)}>
                        </td>
					</tr>
                    <tr>
						<td ><{$smarty.const._LB_DISABLED|utf8_escape_html}>&nbsp;:&nbsp;</td>
						<td colspan="3"><input type="checkbox" value="1" name="DISABLED" <{if $press->DISABLED}>checked<{/if}>/></td>
					</tr>
					<tr>
						  <td class="submit" colspan="4" style="padding-top:10px"><br />
								<a class="tribullet" href="<{$backlink}>"><{$smarty.const._LB_BACK}></a>
								<a class="tribullet" href="#" onclick="validate()"><{$smarty.const._LB_VALIDATE}></a>
							</td>
						</tr>

				</table>
				</form>

			</div>
		</div>
<{include file="footer.html"}>
